<html>
<body style="background-color: #E5FDFC;">
<h3>DESFire cards - Known Bugs</h3>
<p>Android has a bug which interferes with DESFire cards, a popular card for payment systems.
We have built a workaround, but that workaround comes with some limitations of its own. Please
read this page carefully in order to avoid problems.</p>
<h4 id="reader">Reader limitations</h4>
<p>In order to enable you to read DESFire cards, we are using a workaround. However, this
workaround also breaks Android's method of detecting if a card has been removed. This means that
you will have to manually tell Android if you remove the card.</p>
<p>In the application, there is a reset button. Once you hold a card to the device, this button will
change to read "Forget card". Once you have removed the card again, please press that button to let
android know about this.</p>
<p><b>Until you have pressed that button, Android will not detect new NFC Tags!</b></p>
<p>That's all you need to know in order to use the application. If you are interested in technical
details, read on.</p>
<h5>Technical details</h5>
<p>Android periodically communicates with attached NFC tags in order to make sure that they are
still present. For this, it sends a command to the card and checks if it receives a reply. These
commands are usually NOPs ("<b>N</b>o <b>OP</b>eration", commands that don't do anything).</p>
<p>However, the Android NFC libraries seem to have a bug that leads to them
sending commands to DESFire cards which lock the card into a specific mode. Once a card is locked
into a mode, it will not accept messages using other modes and will reply with an error (0x6e00).
</p>
<p>For our workaround, we start a thread which resets the keepalive timer of the Android NFC
watchdog thread every 100 milliseconds. That way, no keepalive commands are sent and the card is
not locked into any specific mode.</p>
<p>However, this also means that android will not detect the removal of a tag while the workaround
is active. Accordingly, we have to kill the watchdog thread to allow Android to recognize the
removal of a card. For this, we use the button mentioned above: All it does is to kill the workaround
thread. After that has happened, the Android watchdog thread will resume operation and detect the
removal of the card.</p>
</body>
</html>